package com.mlnx.push.websocket.server.topic;

import java.io.Serializable;

/**
 * Created by amanda.shan on 2018/2/6.
 */
public class Topic implements Serializable {

    protected TopicType topicType;

    public Topic(TopicType topicType) {
        this.topicType = topicType;
    }

    public TopicType getTopicType() {
        return topicType;
    }

    public void setTopicType(TopicType topicType) {
        this.topicType = topicType;
    }

    @Override
    public boolean equals(Object obj) {

        if (obj instanceof Topic) {
            Topic topic = (Topic) obj;
            return topic.topicType.equals(topicType);
        }
        return false;
    }

    @Override
    public String toString() {
        return topicType.toString();
    }
}
